<template>
	<view class="agreement">
		<g-navbar :title="currentType.name"></g-navbar>
		<web-view
			:src="currentType.url" />
	</view>
</template>

<script lang="ts" setup>
	import { onLoad } from '@dcloudio/uni-app';
	import global, { IAgreemenType } from '@/global';
	import { ref, Ref } from 'vue';
	import { AGREEMENT_TYPE } from '@/enum/agreement';

	const currentType : Ref<IAgreemenType> = ref(global.agreementOptionsList[AGREEMENT_TYPE.PRIVACY]);

	onLoad((e) => {
		if (e && e.type) {
			currentType.value = global.agreementOptionsList[e.type];
		}
	})
</script>

<style scoped lang="scss">
	@import "./agreement.scss";
</style>